import request from '@/utils/request'


// 上传文件接口
export function importFile(data) {
  return request({
      url: '/person/importfile',
      method: 'post',
      data,
      headers: {
          "Content-Type": 'multipart/form-data'
      },
      isRequest: true
  })
}

export function fetchList(data) {
  return request({
    url: '/person/list',
    method: 'post',
    data
  })
}

export function saveDate(data) {
  return request({
    url: '/person/add',
    method: 'post',
    data
  })
}

export function deleteData(tabeCheckList) {
  const ids = [];
  tabeCheckList.forEach(element => {
    ids.push(element.id);
  });
  return request({
    url: '/person/delete',
    method: 'post',
    data: JSON.stringify(ids)
  })
}

// pendingList 处理列表
export function pendingList(data) {
  return request({
    url: '/BusinessList/dbx',
    method: 'get',
    params: data
  })
}

// completedList 办结
export function completedList(data) {
  return request({
    url: '/BusinessList/bjx',
    method: 'get',
    params: data
  })
}

// processedList 已办
export function processedList(data) {
  return request({
    url: '/BusinessList/ybx',
    method: 'get',
    params: data
  })
}

// 下拉框
export function getDictByDictType(data) {
  return request({
    url: '/basic/dict',
    method: 'get',
    params: { "dictType": data }
  })
}

// 流转意见表格
export function getLzyj(data) {
  return request({
    url: '/basic/lzyj',
    method: 'get',
    params: { "rwid": data }
  })
}

// 处理列表
export function getPendingForm(data) {
  return request({
    url: '/basic/pendingForm',
    method: 'get',
    params: data
  })
}

// 附件列表
export function getAttachmentList(data) {
  return request({
    url: '/basic/attachements',
    method: 'get',
    params: data
  })
}

// 发送树形结构
export function getNextActivityParticipants(data) {
  return request({
    url: '/basic/nextActivityParticipants',
    method: 'get',
    params: data
  })
}

// 流程发送
export function lcfs(data) {
  return request({
    url: '/basic/lcfs',
    method: 'post',
    data: JSON.stringify(data)
  })
}

// 创建流程
export function getWorkSpaceCreation(data) {
  return request({
    url: '/basic/workspace',
    method: 'get',
    params: data
  })
}

// 业务创建
export function ywcj(data) {
  return request({
    url: '/basic/ywcj',
    method: 'post',
    data: { "rwlx": data }
  })
}

// 回退树形数据
export function getPreviousActivityParticipants(data) {
  return request({
    url: '/basic/previousActivityParticipants',
    method: 'get',
    params: data
  })
}

// 处理业务回退展示和隐藏
export function getControlButtons(data) {
  return request({
    url: '/basic/controlButtons',
    method: 'get',
    params: { "hjId": data }
  })
}

// 在线预览
export function getFileDisplayUrl(data) {
  return request({
    url: '/basic/fileDisplayUrl',
    method: 'get',
    params: { "fileId": data }
  })
}

// 工作台显示数量
export function getPendingListCount(data) {
  return request({
    url: '/basic/pendListCount',
    method: 'get',
    params: data
  })
}

// 发送验证
export function sendValidate(data) {
  return request({
    url: '/basic/sendValidate',
    method: 'get',
    params: data
  })
}

// 表格保存
export function saveTable(data) {
  return request({
    url: '/basic/save',
    method: 'post',
    data: JSON.stringify(data)
  })
}

// 查询表
export function queryTableData(data) {
  return request({
    url: '/basic/tableData',
    method: 'get',
    params: data
  })
}

// 表单控制操作
export function controlFields(data) {
  return request({
    url: '/basic/controlFields',
    method: 'get',
    params: data
  })
}

// 判断是否为最后一个环节
  
export function checkIsLastTask(data) {
  return request({
    url: '/basic/checkIsLastTask',
    method: 'get',
    params: data
  })
}